package com.cbn.ibcp.jishiting.rms.service.impl;

import com.cbn.ibcp.common.annotation.DataSource;
import com.cbn.ibcp.common.enums.DataSourceType;
import com.cbn.ibcp.jishiting.rms.domain.ResCp;
import com.cbn.ibcp.jishiting.rms.mapper.ResCpMapper;
import com.cbn.ibcp.jishiting.rms.service.IResCpService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Objects;

@Service
@RequiredArgsConstructor
public class ResCpServiceImpl implements IResCpService {

    private final ResCpMapper resCpMapper;


    @DataSource(DataSourceType.ibcp_rms)
    @Override
    public ResCp getById(Long id) {
        if (Objects.isNull(id)) {
            return null;
        }
        return resCpMapper.selectById(id);
    }
}
